﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using OrganizedIN.DAL;
using OrganizedIN.BAL;
using OrganizedIN.BussinessServices;
using System.Data.SqlClient;
using Microsoft.ApplicationBlocks.Data;
using OrganizedIN.BAL.Common;

namespace OrganizedIN.UI.video
{
    public partial class myvideos : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                if (Session["UserID"] != null)
                {
                    DataSet ds = new DataSet();
                    string uid = Convert.ToString(Session["UserID"]);
                    ds = Common.Get_Video_Album_List(uid); // 0-id 1-title 2-created_on
                    if (ds.Tables[0].Rows.Count > 0)
                    {
                        string imgFile = string.Empty;
                        string genHtml = "<ul class='photo_list' style='list-style:none;'>";
                        foreach (DataRow row in ds.Tables[0].Rows)
                        {
                            genHtml += "<li>";
                            genHtml += "<a href='view_album.aspx?album_id=" + row[0].ToString().Trim() + "'><img style='float:left;margin-right:10px;' alt='" + row[1].ToString() + "' src='../../images/video-album.png' width='100px' height='100px' /></a>";
                            genHtml += "<h4>" + row[1].ToString() + "</h4>";
                            genHtml += "<p>Created On: " + row[2].ToString() + "</p>";
                            genHtml += "<div style='clear:both;'></div>";
                            genHtml += "</li>";
                        }
                        genHtml += "</ul>";
                        left_pane.InnerHtml = genHtml;
                    }
                    else
                    {
                        vs.InnerText = "No album(s) found.";
                    }
                }
            }
            catch (Exception ex)
            {
                vs.InnerText = ex.ToString();
            }
        }
    }
}